#coding:utf-8


import requests
import json

js = {
      "offset" : 0,
      "uid" : "0",
      "cate_id" : 2,
      "os" : "2",
      "device_id" : "b5f43edd5eb1abd01bc5bc5bc8320980f80d0dd5",
      "osv" : "2.7",
      "limit" : "40",
      "token" : ""
    }

url = 'http://api.jianmovie.com/productlist'

headers = {'Content-Type': 'application/json'}
# s = requests.post(url,data=json.dumps(js),headers=headers)
# print s.text


info_url = 'http://api.jianmovie.com/productinfo'
info_js = {
          "osv" : "2.7",
          "id" : 1016,
          "os" : "2",
          "uid" : "0",
          "device_id" : "b5f43edd5eb1abd01bc5bc5bc8320980f80d0dd5",
          "token" : ""
        }

# s = requests.post(info_url,data=json.dumps(info_js),headers=headers)
# print s.text


url = 'https://api.meipai.com/hot/feed_timeline.json?build=6264&carrier=46001&channel=8888&client_id=1089857299&device_brand=apple&device_id=7E48AFA4-E04C-49EF-9B41-783A482F8761&idfa=F16BC014-0F88-438F-BE7C-985BEF6C3909&is_first_show=0&is_root=1&language=zh-Hans&local_ip=fe80%3A%3Ae053%3A1a3b%3A5e36%3A4b21&locale=1&model=iPhone11%2C2&network=wifi&os=12.1.2&package_name=com.meitu.mtmv&page=1&remote_ip=&resolution=1125%2A2436&sdk_version=4.4.2&sig=6f62ba3af2aa7a8151fc7ed19040757c&sigTime=1550544195229&sigVersion=1.3&stat_gid=1671594151&timestamp=1550544195000&timezone=GMT%2B8&user_agent=Mozilla/5.0%20%28iPhone%3B%20CPU%20iPhone%20OS%2012_1_2%20like%20Mac%20OS%20X%29%20AppleWebKit/605.1.15%20%28KHTML%2C%20like%20Gecko%29%20Mobile/16C101&version=8.0.91'
url1 = 'https://hotsoon.snssdk.com/hotsoon/feed/?type=video&iid=63727433282&ac=WIFI&ab_version=722448,712302,689928,691946,726136,739179,692223,706102,735572,740417,557631,654195,739936,743736,718682,727427,661944,743427,735438,500980,374104,715928,705072,743060,633216,674800,718586,391709,705119,501248,378843,478016,734849,710143,737679,727728,643985,745178,671290,709962,739459,736846,299907,457535,712848,665355,682009,730256,657399&os_api=18&app_name=live_stream&channel=App%20Store&idfa=F16BC014-0F88-438F-BE7C-985BEF6C3909&device_platform=iphone&live_sdk_version=5.6.3&vid=DF0A1BB5-711F-4BEC-9E5F-06876777A7B4&mccmnc=46001&device_type=iPhone11,2&openudid=04c5706328d80677e569b8b1601ba56901ed33d5&version_code=5.6.3&os_version=12.1.2&screen_width=1125&aid=1112&device_id=60968670195&req_from=feed_refresh&action=refresh&diff_stream=1&mas=00e65694064aec4038080786a4a33fb9b571095bd05e29f919d4e8&as=a205a756f8131ca35b7058&ts=1550545720'

import time
# d = int(1550567638300/1000)
# 
# #转换成localtime
# time_local = time.localtime(d)
# #转换成新的时间格式(2016-05-05 20:28:54)
# dt = time.strftime("%Y-%m-%d %H:%M:%S",time_local)
# print dt
url = 'http://iflow.uczzd.cn/iflow/api/v1/channel/10051?app=ucnews-iflow&recoid=13382415756328462326&ftime=' + str(int(time.time() * 1000)) + '&method=new&count=20&no_op=0&auto=0&content_ratio=0&_tm=' + str(int(time.time() * 1000)) + '&sign=KvhXVFRQEDfcPrzNqvNn9XmaXvk1wkzoPo1z2xT034vgsBNy3yao23AVNMlwQU1OZ6w%3D&sc=&tab=video&uc_param_str=dnnivebichfrmintcpgieiwidsudsvadmeprpf&dn=47225679701-57d37338&nn=Kvn9kgCp3g5ofnlg1VKpLfABQd7N1LiE15uK0%2blr5DHS1A%3d%3d&ve=3.9.6.403&bi=997&ch=&fr=iphone&mi=iPhone11%2c2&nt=2&pc=KvmV1x3IdVeVUcW4KYHoQ%2f0%2b4%2bELgX3j0LxeHwNQoGBLaEFyhqeiySP3D2pMuhpGaAs%3d&gp=&me=Kvn%2fX8kLyMvkKrH95ZMI6T%2b%2fN8oOL6fb9QwvAhzJ1WH0O5GHA1pbvAt%2fBxAr9lTveFI%3d&wf=&ut=KvntTm%2bObsmpO0RTGRFDBXMUTzP19zBAGnE9yzS166P%2bzA%3d%3d&ai=Kvk%3d&sv=app&ad=&pr=UCNewsApp&pf=195'
print url


d = '''<xml><ToUserName><![CDATA[gh_bd79ca73420b]]></ToUserName>
        <FromUserName><![CDATA[ofP1et0xPRjlZ_nH_vTM4S-jWf3Y]]></FromUserName>
        <CreateTime>1550651266</CreateTime>
        <MsgType><![CDATA[event]]></MsgType>
        <Event><![CDATA[CLICK]]></Event>
        <EventKey><![CDATA[WEATHER]]></EventKey>
        </xml>'''
try:
    import xml.etree.cElementTree as ET
except ImportError:
    import xml.etree.ElementTree as ET
    
root = ET.fromstring(d)
openid = root.find('FromUserName').text
event = root.find('Event').text
content = root.find('EventKey').text
msgtype = root.find('MsgType').text
print openid
print event
print content
print msgtype

url = [
            ]